<?php

/**
 * Subclass for representing a row from the 'post' table.
 *
 * 
 *
 * @package lib.model
 */ 
class Post extends BasePost
{
  public function getTagArray()
  {  	
    $tags = array();	  
    foreach($this->getPostTagsJoinTag() as $post_tag)
    {
      $tags[] = $post_tag->getTag()->getHandle(); 
    }
    return($tags);
  }
  
  public function getTagPhrase()
  {
    return(implode(' ', $this->getTagArray()));
  }
  
  public function getCultures()
  {
    $c = new Criteria();
    $c->add(PostI18nPeer::ID, $this->getId());
    $i18ns = PostI18nPeer::doSelect($c);
    
    $languages = array();
    foreach ($i18ns as $i18n)
    {
      $languages[] = $i18n->getCulture();
    }
    return $languages;    
  }   
}
